From: Brad Jorsch Date: Mon, 16 May 2016 16:46:58 +0000 (-0400) Subject: Avoid unstubbing $wgLang in Title::getLocalURL X-Git-Tag: 1.31.0-rc.0~6964^2 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=67881de44e6728bde2911ea0b73957baf626c243;p=lhc%2Fweb%2Fwiklou.git Avoid unstubbing $wgLang in Title::getLocalURL If $query doesn't match the regex, there's no point in unstubbing $wgLang if that's what happens to be the page language. This also avoids it blowing up if $wgLang isn't usable due to MW_NO_SESSION. Bug: T135389 Change-Id: I9a6779c4cc887205215a815db3a765c35f060c42 --- diff --git a/includes/Title.php b/includes/Title.php index 876afe620c..25fbce3f57 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1713,9 +1713,9 @@ class Title implements LinkTarget { if ( $url === false && $wgVariantArticlePath + && preg_match( '/^variant=([^&]*)$/', $query, $matches ) && $wgContLang->getCode() === $this->getPageLanguage()->getCode() && $this->getPageLanguage()->hasVariants() - && preg_match( '/^variant=([^&]*)$/', $query, $matches ) ) { $variant = urldecode( $matches[1] ); if ( $this->getPageLanguage()->hasVariant( $variant ) ) {